package com.hangyixing.decode.service.common;




public class DecodeHelper {


    public static String decode(String s1) {


        String[] s2 = s1.split("/");
        s2[0]="."+s2[0];

        switch (s1.charAt(0)) {
            case 'V':
                if (s2[1].substring(0, 1).equals("1")) {
                    s2[1] = "DN;" + "L;" +  s2[1].substring(2, s2[1].length()) ;
                }
                if (s2[1].substring(1, 2).equals("L")) {
                    s2[1] = "DN;" + s2[1].substring(1, 2)+"L;" + s2[1].substring(2, s2[1].length()) ;
                }
                if (s2[1].substring(1, 2).equals("T")) {
                    s2[1] =  "DN;" + "T;"+ s2[1].substring(2, s2[1].length()) ;
                }
                if (s2[1].substring(1, 2).equals("R")) {
                    s2[1] = "DN;" + "R;" + s2[1].substring(2, s2[1].length()) ;
                }
                if (s2[1].substring(1, 2).equals("X")) {
                    s2[1] = "DN;" + "X;" + s2[1].substring(2, s2[1].length()) ;
                }
                String str3 = cc.convertArrayToString(s2);
                return str3;

            case 'J':
                if (s2[1].equals("R")) {
                    s2[1] =  "R";
                }
                if (s2[1].equals("S")) {
                    s2[1] =  "S";
                }
                if (s2[1].equals("H")) {
                    s2[1] =  "H";
                }
                if (s2[1].equals("G")) {
                    s2[1] =  "G";
                }
                s2[2] = s2[2];   //+ "操作人员ID;";
                if (s2[2]==null||s2[2].length()==0){
                    s2[2] =  "OIT";
                }
                s2[3] =  "OIT";
                s2[4] = s2[4];  // + "处理日期;";
                s2[5] = s2[5];  // + "时分秒;";
                s2[6] =  "OIT";
                s2[7] =  "OIT";


            if (s2[8].equals("CK")) {
                s2[8] =  "CK";
            }
            if (s2[8].equals("BD")) {
                s2[8] =  "BD";
            }
            if (s2[8].equals("OF")) {
                s2[8] = "OF";
            }
            if (s2[8].equals("GT")) {
                s2[8] = "GT";
            }
            if (s2[8].equals("SP")) {
                s2[8] =  "SP";
            }
            if (s2[8].equals("CL")) {
                s2[8] = "CL";
            }
            if (s2[8].equals("SC")) {
                s2[8] = "SC";
            }
            if (s2[8].equals("SE")) {
                s2[8] =  "SE";
            }
            if (s2[8].equals("RM")) {
                s2[8] =  "RM";
            }
            if (s2[8].equals("MU")) {
                s2[8] =  "MU";
            }
            if (s2[8].equals("LL")) {
                s2[8] =  "LL";
            }
            if (s2[8].equals("OH")) {
                s2[8] =  "OH";
            }
            if (s2[8].equals("BS")) {
                s2[8] =  "BS";
            }
            if (s2[8].equals("AC")) {
                s2[8] =  "AC";
            }
            if (s2[8].equals("SY")) {
                s2[8] =  "SY";
            }
            if (s2[8].equals("ME")) {
                s2[8] =  "ME";
            }
            if (s2[8].equals("TI")) {
                s2[8] =  "TI";
            }
            if (s2[8].equals("LI")) {
                s2[8] =  "LI";
            }
            if (s2[8].equals("II")) {
                s2[8] =  "II";
            }
            if (s2[8].equals("XI")) {
                s2[8] =  "XI";
            }
            if (s2[8].equals("TP")) {
                s2[8] = "TP";
            }
            if (s2[8].equals("DS")) {
                s2[8] =  "DS";
            }
            if (s2[8].equals("PX")) {
                s2[8] =  "PX";
            }

                if (s2.length>9) {
                    if (s2[9].equals("SE")) {
                        s2[9] = "SE";
                    }
                    if (s2[9].equals("CK")) {
                        s2[9] = "CK";
                    }
                    if (s2[9].equals("BD")) {
                        s2[9] = "BD";
                    }
                    if (s2[9].equals("OF")) {
                        s2[9] = "OF";
                    }
                    if (s2[9].equals("GT")) {
                        s2[9] = "GT";
                    }
                    if (s2[9].equals("SP")) {
                        s2[9] = "SP";
                    }
                    if (s2[9].equals("CL")) {
                        s2[9] = "CL";
                    }
                    if (s2[9].equals("SC")) {
                        s2[9] = "SC";
                    }
                    if (s2[9].equals("RM")) {
                        s2[9] = "RM";
                    }
                    if (s2[9].equals("MU")) {
                        s2[9] = "MU";
                    }
                    if (s2[9].equals("LL")) {
                        s2[9] = "LL";
                    }
                    if (s2[9].equals("OH")) {
                        s2[9] = "OH";
                    }
                    if (s2[9].equals("BS")) {
                        s2[9] = "BS";
                    }
                    if (s2[9].equals("AC")) {
                        s2[9] = "AC";
                    }
                    if (s2[9].equals("SY")) {
                        s2[9] = "SY";
                    }
                    if (s2[9].equals("ME")) {
                        s2[9] = "ME";
                    }
                    if (s2[9].equals("TI")) {
                        s2[9] = "TI";
                    }
                    if (s2[9].equals("LI")) {
                        s2[9] = "LI";
                    }
                    if (s2[9].equals("II")) {
                        s2[9] = "II";
                    }
                    if (s2[9].equals("XI")) {
                        s2[9] = "XI";
                    }
                    if (s2[9].equals("TP")) {
                        s2[9] = "TP";
                    }
                    if (s2[9].equals("DS")) {
                        s2[9] = "DS";
                    }
                    if (s2[9].equals("PX")) {
                        s2[9] = "PX";
                    }
                }
                    String str4 = cc.convertArrayToString(s2);
                    return str4;

            case 'I':
                s2[1] = s2[1] ;
                s2[2] = s2[2] ;
                s2[3] = s2[3] ;
                s2[4] = s2[4] ;
                String str5 = cc.convertArrayToString(s2);
                return str5;

            case 'F':
                s2[1] = s2[1] ;
                s2[2] = s2[2] ;
                s2[3] = s2[3] ;
                s2[4] = s2[4] ;
                String str6 = cc.convertArrayToString(s2);
                return str6;

            case 'N':
                if (s2[1].length()>10){
                    s2[1] = s2[1].substring(0, 10)  +";" +s2[1].substring(10, 13) ;//+ "FNB;"+ "NB";

                }
                s2[1] = s2[1].substring(0, 10)  +";"+"001";
                String str7 = cc.convertArrayToString(s2);
                return str7;
            case 'S':
                s2[1] =  "OIT";
                s2[2] = s2[2] ;
                if (s2[3].equals("C")) {
                    s2[3] =  "C";
                }
                if (s2[3].equals("B")) {
                    s2[3] =  "B";
                }
                if (s2[3].equals("N")) {
                    s2[3] =  "N";
                }
                if (s2[3].equals("S")) {
                    s2[3] =  "S";
                }
                s2[4] =  "OIT";
                s2[5] = s2[5] ;

                String str8 = cc.convertArrayToString(s2);
                return str8;

            case 'P':
                s2[1] = s2[1] ;
                s2[2] = s2[2] ;
                String str9 = cc.convertArrayToString(s2);
                return str9;
            case 'R':
                s2[1] = s2[1]  ;
                String str10 = cc.convertArrayToString(s2);
                return str10;

            case 'X':

                if (s2[1].equals("SEL")) {
                    s2[1] =  "SEL";
                }
                if (s2[1].equals("NON")) {
                    s2[1] =  "NON";
                }
                if (s2[2].equals("CLR")) {
                    s2[2] =  "CLR";
                }
                if (s2[2].equals("REJ")) {
                    s2[2] = s2[2] ;
                }
                if (s2[2].equals("UCL")) {
                    s2[2] =  "UCL";
                }
                if (s2[3].equals("D")) {
                    s2[3] =  "D";
                }
                if (s2[3].equals("E")) {
                    s2[3] = "E";
                }
                if (s2[3].equals("C")) {
                    s2[3] =  "C";
                }
                if (s2[3].equals("N")) {
                    s2[3] =  "N";
                }
                if (s2[3].equals("T")) {
                    s2[3] =  "T";
                }
                s2[4] =  "SM";
                s2[5] =  "A";
                s2[6] =  "FT";
                String str11 = cc.convertArrayToString(s2);
                return str11;


            case 'W':
                if (s2[1].equals("L")) {
                    s2[1] =  "L";
                }
                if (s2[2].equals("K")) {
                    s2[2] =  "K";
                }
                if (s2[1].equals("P")) {
                    s2[1] =  "P";
                }
                s2[2] = s2[2] ;
                s2[3] = s2[3] ;
                String str12 = cc.convertArrayToString(s2);
                return str12;



        }
        return s1;
    }
}

